/**
 * Created by zjw on 16/8/31.
 */
define([], function() {
    'use strict';
    return angular.module('login', [])
        .controller('LoginController', ['$scope', '$http', '$state', function($scope, $http, $state) {
            console.log('LoginController');
            $scope.labels = {
                penal: '请登录',
                email: '邮箱',
                userId: '用户名',
                password: '密码',
                emailPlaceHolder: '123@abc.com',
                userIdPlaceHolder: '请输入英文,数字或"_"',
                passwordPlaceHolder: '请输入最少8位英文,数字',
                login: '登录',
                reset: '重置'
            };

            $scope.formData = {
                email: '',
                userId: '',
                password: '',
                autoLogin: false
            };

            $scope.btns = {
                login: function() {
                    var form = document.getElementsByTagName('form');
                    console.log($scope.formData);
                    $state.go('store.home');

                    // $http.post('')

                },
                reset: function() {
                    $scope.formData = {
                        email: '',
                        userId: '',
                        password: '',
                        autoLogin: false
                    };
                    console.log($scope.formData);
                }
            }
        }]);
});